<script type="text/javascript">
  // show 
  function ajaxSearch() {
            var input_data = $('#search_data').val();
            if (input_data.length === 0) {
                $('#suggestions').hide();
            } else {

                var post_data = {
                    'search_data': input_data,
                    '<?php echo $this->security->get_csrf_token_name(); ?>': '<?php echo $this->security->get_csrf_hash(); ?>'
                };

                $.ajax({
                    type: "POST",
                    url: "<?php echo base_url(); ?>order/autocompleteorder/",
                    data: post_data,
                    success: function(data) {
                        // return success
                        if (data.length > 0) {
                            $('#suggestions').show();
                            $('#autoSuggestionsList').addClass('auto_list');
                            $('#autoSuggestionsList').html(data);
                        }
                    }
                });

            }
        }
</script>
<form class="form-horizontal" role="form" method="post" action="<?=site_url('order/makeOrder/') ?>">  
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">Sản phẩm</label>
    <div class="col-sm-3">
      <input id="search_data" type="text" name="search_data" onkeyup="ajaxSearch();" class="form-control" placeholder="Nhập mã sản phẩm cần tìm.." value="" required autofocus>
    </div>
  </div>  
  <!-- hiển thị size sản phẩm -->  
  <div id="autoSuggestionsList"></div>        
  <!-- hiển thị size sản phẩm -->
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">Khách hàng</label>
    <div class="col-sm-3">
      <input id="codeInput" type="text" name="customer_name" class="form-control" placeholder="Khách hàng" value="" required>
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">Số điện thoại</label>
    <div class="col-sm-3">
      <input id="codeInput" type="text" name="customer_phone" class="form-control" placeholder="Sđt" value="" required>
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
    <div class="col-sm-3">
      <input id="codeInput" type="text" name="customer_email" class="form-control" placeholder="Email" value="">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">Địa chỉ</label>
    <div class="col-sm-3">
      <input id="codeInput" type="text" name="address" class="form-control" placeholder="Địa chỉ" value="" required>
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">Tình trạng</label>    
    <div class="col-sm-3">
      <select class="form-control" name="status">
        <option>--Tất cả--</option>
        <option value="pending">Đang chờ</option>
        <option value="failed" >Thất bại</option>
        <option value="process">Đang xử lý</option>
        <option value="completed">Hoàn tất</option>
        <option value="refund">Hoàn tiền</option>
        <option value="cancel">Hủy</option>
      </select>
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">Ghi chú</label>
    <div class="col-sm-3">
      <textarea class="form-control" rows="3" name="note"></textarea>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" name="makeOrderBtn" value="makeOrderBtn" class="btn btn-primary">Tạo</button>
    </div>
  </div>    
</form>